import axios from "axios";

const http = axios.create({
    baseURL: 'http://localhost:9000',
    timeout: 10000,
})

http.interceptors.request.use(function (config) {
    const token = 'Besc eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTcsIm5hbWUiOiJ1c2VyIiwiaWF0IjoxNzE4NDI5NDQ3LCJleHAiOjE3MTg1MTU4NDd9.uPbfnBn6fpdyvpqsXuOW70yUJuS3yUtg87q9K0DwNRbxGPGybF3SNIWx6yU1zqkaxAwhdp6_0to8Q3BEucrAYbFjc7ZgwaUYfZG4O8a3wjnSuFkDdpXVTNe3a-v-27YOnym6JT3eEJlDRKTpLGVZQr4ZJMtuzFnfySGxzgXuhOuNzHfdLcMocHEf2OEt8Ijgeig5NzhlPnLOpH5vZizhg2G3hEzwdz4O0FZMHFPD6QFORCVNnlQMr6z2dJXvubpL7S-B1qN8TxNVd-9sFc0X0tf44O6F9IfyyM7aelW8ML4Mpiz6lg2UOcG08e2D9UquBqnZO0Uc38OgPxpJv1Zx7w'
    if (token) {
        config.headers.Authorization = token
    }
    return config
})

http.interceptors.response.use(function (response) {
    return response.data.data
})

export default http;